//拖拽
function drag(obj){

	obj.onmousedown = function (ev){
		var ev = ev || event;

		var disX = ev.clientX - this.offsetLeft;
		var disY = ev.clientY - this.offsetTop;

		document.onmousemove = function (ev){
			var ev = ev || event;

		 	obj.style.left = ev.clientX -disX + 'px';
		 	obj.style.top = ev.clientY - disY + 'px';
		 }

		 document.onmouseup = function (){

		 	document.onmouseup = document.onmousemove = null;

		 	obj.releaseCapture && obj.releaseCapture();		//取消全局捕获
		 }

		 obj.setCapture && obj.setCapture();					//设置全局捕获		阻止文字默认行文(IE8以下)
		 return false;											//阻止文字默认行文(标准下)
	}
}